<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:68:"/data/wwwroot/luckyDraw/m/public/../application/view/jihuo/index.php";i:1494034806;}*/ ?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <title>验证序列号</title>
    <link rel="stylesheet" href="<?php echo \think\Config::get('style'); ?>/wx/css/bootstrap.css">
    <link rel="stylesheet" href="<?php echo \think\Config::get('style'); ?>/wx/css/font-awesome.css">
    <link rel="stylesheet" href="<?php echo \think\Config::get('style'); ?>/wx/css/cl-style.css">
<script type="text/javascript" src="<?php echo \think\Config::get('style'); ?>/js/jweixin-1.0.0.js"></script>
<script>
  wx.config(<?php echo $signPackage; ?>);
  wx.ready(function () {
    // 在这里调用 API
    wx.hideOptionMenu();
  });

  
 function checkScanQRCode() {
	wx.scanQRCode({
	    needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
	    scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
	    success: function (res) {
	    	var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
	    	$("#yanzhengma").val(result.substr(-12));
	    	CheckLPNO();
	    
		}
	});
}

  
</script>
</head>
<body>

 <div class="container-fluid">
     <div class="row">
         <header class="cl-Forgetpasswd-header">
             <ul>
                 <li class="col-xs-3"></li>
                 <li class="col-xs-6 text-center"><span class="text-center">验证序列号</span></li>
                 <li class="col-xs-3"></li>
             </ul>
         </header>
         <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
             <!-- Indicators 
             <ol class="carousel-indicators">
                 <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                 <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                 <li data-target="#carousel-example-generic" data-slide-to="2"></li>
             </ol>-->

             <!-- Wrapper for slides -->
             <div class="carousel-inner" role="listbox">
                 <div class="item active">
                     <img src="<?php echo \think\Config::get('style'); ?>/wx/image/banner.jpg" alt="...">
                     <div class="carousel-caption">
                        
                     </div>
                 </div>
               <div class="item">
                     <img src="<?php echo \think\Config::get('style'); ?>/wx/image/banner2.jpg" alt="...">
                     <div class="carousel-caption">
                        
                     </div>
                 </div>
                <div class="item">
                     <img src="<?php echo \think\Config::get('style'); ?>/wx/image/banner3.jpg" alt="...">
                     <div class="carousel-caption">
                        
                     </div>
                 </div>

             </div>

             <!-- Controls 
             <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                 <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                 <span class="sr-only">Previous</span>
             </a>
             <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                 <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                 <span class="sr-only">Next</span>
             </a>-->
         </div>

         <div class="cl-VerifyKey-main">
             <form>
                 <div class="form-group">
                     <ul class="row">
                         <li class="col-xs-9">
                     <label for="Newpassword" class="sr-only">序列号</label>
                     <div class="input-group">
                         <span class="input-group-addon cl-lnput-icon"><i class="fa fa-barcode fa-lg"></i></span>
                         <input type="text" class="form-control" id="yanzhengma" name="lpno" size="12" placeholder="请输入您的序列号">
                     </div>
                         </li>
                         <li class="col-xs-3">
                             <div class="cl-saosao2" onClick="checkScanQRCode();"></div>
                         </li>
                     </ul>
                 </div>
                 <div class="form-group">
                     <button type="button" class="btn btn-block btn-warning" onclick="CheckLPNO();">下一步</button><!---  状态成功后disabled标签被删除 ---->
                 </div>
                 <div class="form-group">
                     <p>
					1.票是实名制的，一旦激活只限本人使用，激活成功之后信息无法更改。<br>
					2.会员号在此微信登陆后自动绑定，无法退出，请慎重操作！
				</p>
                 </div>
				
             </form>

         </div>
     </div>
 </div>

</body>
<script>
	function CheckLPNO(){
		if((/^\d{12}$/.test($('#yanzhengma').val()))){
			var url="<?php echo url('isTrue'); ?>";
			   var datastr="lianpiaono="+$.trim($("#yanzhengma").val());
			   $.ajax({
			        url: url,
			        data: datastr,
			        type: "POST",
			        dataType: "json",
			        success: function(data) {
			            if (data.status==1) {
			            	 window.location="<?php echo url('jihuo'); ?>&lpno="+$('#yanzhengma').val();
			            	//$("#hd_ulianpiaono").html(data.msg);
			            }else{
			            	alert(data.msg);
			            }
			        },
			       error:function(XMLHttpRequest, textStatus, errorThrown){
			       	alert(XMLHttpRequest.readyState);
			       }
			    })
		}else{
			alert('联票号错误,请核查!');
		}
	}
</script>
<script type="text/javascript" src="<?php echo \think\Config::get('style'); ?>/wx/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="<?php echo \think\Config::get('style'); ?>/wx/js/bootstrap.min.js"></script>
	
</html>